package cn.jiyun.controller;


import cn.jiyun.common.config.Result;
import cn.jiyun.entity.Locationinfo;
import cn.jiyun.service.LocationinfoService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/locationinfo")
@CrossOrigin
public class LocationinfoController {
    @Autowired
    private LocationinfoService locationinfoService;
    //查询所有
    @RequestMapping("/findPage")
    public Result findPage(Integer pageNum, Integer pageSize , @RequestBody Locationinfo location){
        Page<Locationinfo> page= locationinfoService.findPage(pageNum,pageSize,location);
        return Result.ok(page);
    }
    @RequestMapping("toDw")
    public Result toDw(Integer id){
       Locationinfo locationinfo = locationinfoService.toDw(id);
        return Result.ok(locationinfo);
    }
}
